package cn.wyu.service;

import cn.wyu.dao.ActicleDao;
import cn.wyu.dao.ArticleDaoimpl;
import cn.wyu.pojo.Article;

import java.util.List;

public class ArticleServiceImpl implements ArticleService {

    private ActicleDao dao = new ArticleDaoimpl();
    //通过这里访问DAO层
    @Override
    public List<Article> findArticleType(String typeCode) {

        List<Article> list = dao.findByArticleType(typeCode);
//        list.forEach(article -> {
//            System.out.println(article);
//        });

        return list;
    }

    @Override
    public String findArticle(String typeCode){

        String articleType = dao.findArticleType(typeCode);
        return  articleType;
    }
}
